﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc.UI.Theming;
using Volo.Abp.DependencyInjection;

namespace Acme.BookStore.Web
{
    //public class DefaultTheme
    //{
    //}
    [ThemeName(DefaultThemeName)]
    public class DefaultTheme: ITheme, ITransientDependency
    {
        public const string DefaultThemeName = "Default";

        public string GetLayout(string name, bool fallbackToDefault = true)
        {
            switch (name)
            {
                case StandardLayouts.Application:
                    return "~/Themes/Default/Layouts/Application.cshtml";
                case StandardLayouts.Account:
                    return "~/Themes/Default/Layouts/Account.cshtml";
                case StandardLayouts.Empty:
                    return "~/Themes/Default/Layouts/Empty.cshtml";
                default:
                    return fallbackToDefault ? "~/Themes/Default/Layouts/Application.cshtml" : null;
            }
        }
    }
}
